package com.nuoniu.sibanyun.mapper.finance;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nuoniu.sibanyun.entity.VRuleVoucherType;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 凭证分类 Mapper 接口
 * </p>
 *
 * @author 小啊刚
 * @since 2022-06-13
 */
public interface VRuleVoucherTypeMapper extends BaseMapper<VRuleVoucherType> {

    @Select("select * from fab_rule_voucher_type where company_id=#{companyId} and name=#{name}")
    VRuleVoucherType getByName(String name, Integer companyId);

    @Select("select count(1) from fab_rule_voucher_set_main where type=#{id}")
    int getVoucherCount(Long id);
}
